package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.ChatMessage;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface ChatMessageMapper {
    int deleteByPrimaryKey(Long id);

    int insert(ChatMessage record);

    ChatMessage selectByPrimaryKey(Long id);

    List<ChatMessage> selectForList(QueryObject qo);

    int updateByPrimaryKey(ChatMessage record);

    void updateStatus();

    Set<Long> queryChatSetBySenderId(Long userId);

    Set<Long> queryChatSetByreceiverId(Long userId);

    Integer countForUnreadByUserId(@Param("status") Boolean status, @Param("userId") Long userId);

    Integer countForUnreadByTwoPerson(@Param("currentUserId") Long currentUserId, @Param("userId") Long userId);

    ChatMessage selectByLastDate(@Param("currentUserId") Long currentUserId, @Param("userId") Long userId);
}